package org.ala.tiktools.tools;

/**
 * 断言类
 *
 * @author ala
 * @date 2025-04-04 10:38
 */
public class Assert {


    /**
     *  如果表达式为false，抛出指定运行时异常
     */
    public static <E extends RuntimeException> void assertTrue(boolean expression, E e) {
        if (!expression) {throw e;}
    }
    /**
     *  如果表达式为false，抛出Runtime
     */
    public static void assertTrue(boolean expression, String msg) {
        assertTrue(expression, new RuntimeException(msg));
    }
}
